﻿using System;
using System.Web.UI;
using BLL;

public partial class ProductAging_ViewAging_ViewAgingbySN : System.Web.UI.Page
{
    private Aging ag;
    //private static string agingID, productSN, agingStep;

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public ProductAging_ViewAging_ViewAgingbySN()
    {
        ag = new Aging();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string productSN = this.TextBox1.Text.Trim();
        productSN = CommHelper.GetProductSN(productSN);
        string agingStep = this.DropDownList1.SelectedItem.Text;
        string agingID = ag.GetIDbySN(productSN, agingStep);
        if (string.IsNullOrEmpty(agingID))
        {
            string str1 = "此腔体序列号没有做过" + agingStep;
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "<script>alert('" + str1 + "');</script>", false);
        }
        else
        {
            BindAging(agingID);
        }
    }

    protected void BindAging(string agingID)
    {
        UserControl_Aging uc = (UserControl_Aging)LoadControl("~/UserControl/Aging.ascx");
        uc.agingID = agingID;
        this.PlaceHolder1.Controls.Add(uc);
    }
}
